// 当前这个模块：API进行统一管理
import requests from "./request";
import mockRequests from './mockRequest'
// 三级联动接口
// /api/product/getBaseCategoryList    get 无参数
// 发请求
export const reqCategoryList = () => requests({ url: '/product/getBaseCategoryList' })

// 获取banner（Home主页轮播图接口）
export const reqBannerList = () => mockRequests({ url: '/banner' })

// 获取floor组件数据
export const reqFloorList = () => mockRequests.get('/floor')

// 获取Search模块数据
export const reqSearchInfo = (params) => requests({ url: "/list", method: "post", data: params })

// 获取商品详情 /api/item/{ skuId }
export const reqGoodsInfo = (skuId) => requests.get(`/item/${skuId}`)

// 将产品添加至购物车
export const reqAddCart = (skuId, skuNum) => requests.post(`/cart/addToCart/${skuId}/${skuNum}`)

// 获取购物车列表数据接口
export const reqCartList = () => requests.get('/cart/cartList')

// 删除购物车产品
export const reqDeleteCart =(skuId) =>requests.delete(`/cart/deleteCart/${skuId}`) 

// 修改商品选中状态
export const reqUppdateCheck=(skuId,isChecked)=>requests({url:`/cart/checkCart/${skuId}/${isChecked}`,method:'get'})

// 获取验证码
export const reqGetCode =(phone)=>requests.get(`/user/passport/sendCode/${phone}`)

// 注册
export const reqUserRegister = (data)=>requests({url:'/user/passport/register',data,method:'post'});
